<?php
namespace app\model;

use think\Model;

class Bazaar extends Model
{
	protected $table = 'cfg_bazaar';

	public static function getList( $array, $platform = false ) {
		$where = [];
		array_push($where, ['companyId', '=', $array['companyId']]);
		if($platform !== false) {
			array_push($where, ['platform', '=', $platform]);
		}
		$query = self::field('id, name, model, platform, status')->where($where)->order('sort', 'desc')->select()->toArray();
		return $query;
	}
}